import Vue from "vue";
import VueRouter from "vue-router";

// 引入路由组件
import Home from "@/views/Home";
import Search from "@/views/Search";
import Login from "@/views/Login";
import Register from "@/views/Register";

Vue.use(VueRouter);

export default new VueRouter({
  mode: "history",
  routes: [
    {
      path: "/home",
      name: "Home",
      component: Home,
    },
    {
      path: "/search",
      name: "Search",
      component: Search,
    },
    {
      path: "/login",
      name: "Login",
      component: Login,
      meta: {
        isHiddenFooter: true,
      },
    },
    {
      path: "/register",
      name: "Register",
      component: Register,
      meta: {
        isHiddenFooter: true,
      },
    },
    {
      path: "/",
      redirect: "/home",
    },
  ],
});
